#!usr/bin/env python  
# -*- coding: utf-8 -*-
""" 
@author:Simon
@file: objdemo10.py 
@time: 2018/01/18 
"""
class Fib(object):
    def __init__(self):
        self.a, self.b = 0,1

    def __iter__(self):
        return self

    def __next__(self):
        self.a = self.b
        self.b = self.a + self.b
        if self.a > 10000:
            raise StopIteration()
        return self.a

for n in Fib():
    print(n)